home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
tptc16.zip
/
TEST.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-01-04
|
3KB
|
113 lines
(*
* This program demonstrates some weaknesses in TPC 1.4 and TPC 1.5. Unless
* otherwise noted, all failed translations are in 1.4 and corrected in 1.5.
*
*)
program Test;
var
vector : Integer absolute $0000:$03c4;
(* absolute variables not translated in tpc 1.5 *)
Ch : Char;
IbmAt : Boolean;
Control : Boolean;
type
Longstring = string[255];
Lookup = Array[1..7,0..1] of integer;
(* multi-dimension array declarations not translated
in tpc 1.5 *)
const
tab : Lookup = { this goes haywire here }
((10,824), (9,842), (9,858), (9,874),
(10,890), (9,908), (9,924));
procedure InvVid(m: longstring); {added}
begin
writeln(m);
end;
procedure call_a; {added}
begin
end;
procedure call_b(L : Integer;
table : Lookup);
const
seg_addr = $0040; {constants added}
filter_ptr = $200;
Vert = '|';
Dbl = '==';
begin
Write(Memw[seg_addr : Filter_Ptr] + 1); GotoXY(4,4);
GotoXY(4,11);
{ put this next line in blows up -- }
InvVid(Vert+' Retrieve '+Dbl+' Save '+Dbl+
' Combine '+Dbl+' Xtract '+Dbl+' Erase '+
Dbl+' List '+Dbl+' Import '+Dbl+
' Directory '+ Vert);
end;
{---------------------------------------------------------------------}
{ }
{ THIS IS WHERE THE PROGRAM STARTS EXECUTING }
{ }
{---------------------------------------------------------------------}
procedure main_block; {renamed; 'main' is reserved in C}
begin
if Mem[$ffff:$0e] = $FC then
begin
IbmAt := True;
end;
Repeat
if IbmAt then
begin
Control := True;
end
else
{ call_a; if you comment this out, blows up }
{ end; what's this? turbo won't take it either }
case Ch of
'1'..'8': call_a; { fails to put in cases from 2 to 7 }
'Z' : call_a;
'z' : begin end; { do nothing }
else
{ Do Nothing }
{ call_a; if you comment this out, blows up }
end;
Until (Ch = Chr(13)) OR (Ch = 'Z');
end;
begin
(* main block *)
main_block;
end.